<\%@ page contentType="text/html;charset=UTF-8" language="java" %>
<\%@ include file="/common/tags.jsp" %>

<div class="am-u-sm-12">
  <section data-am-widget="accordion" class="am-accordion am-accordion-gapped"
               data-am-accordion='{  }'>
          <dl class="am-accordion-item am-active">
              <dt class="am-accordion-title"><span class="am-icon-search"></span> 查询</dt>
              <dd class="am-accordion-bd am-collapse am-in">
                  <div class="am-accordion-content">
                      <form id="_searchForm">
                      <div class="am-u-sm-3">
                          XXX：<input type="text" name="xxxx" placeholder="xxx" >
                      </div>
                      <div class="am-u-sm-3">
                          XXX：<input type="text" name="xxxx" placeholder="xxx" >
                      </div>
                      <div class="am-u-sm-3">
                          XXX：<input type="text" name="xxxx" placeholder="xxx" >
                      </div>
                      <div class="am-u-sm-3 am-u-end"><button type="button" class="am-btn am-btn-xs am-btn-success" onclick="_search()">查询</button></div>
                      <div class="am-cf"/>
                      </form>
                  </div>
              </dd>
          </dl>
  </section>

  <!--操作按钮-->
      <!--<div class="am-u-md-6 am-cf">
          <div class="am-fl am-cf">
              <div class="am-btn-toolbar am-fl">
                  <div class="am-btn-group am-btn-group-xs">
                      <button type="button" type="button" class="am-btn am-btn-success"><span class="am-icon-plus"></span> 新建</button>
                  </div>
              </div>
          </div>
      </div>-->

  <table class="am-table am-table-striped am-table-hover table-main">
          <thead>
          <tr>
              <th class="table-id">NO</th>
              <!--<th class="table-title">公司名称</th>
              <th class="table-title">联系人</th>
              <th class="table-title">电话</th>
              <th class="table-title">手机</th>
              <th class="table-title">帐号状态</th>
              <th class="table-title">认证状态</th> -->
              <th class="table-set">操作</th>
          </tr>
          </thead>
          <tbody>
          <c:forEach items="${pager.records}" var="item" varStatus="status">
              <tr>
                  <td>${status.index+1}</td>
                 <!-- <td>${item.name}</td>
                  <td>${item.contactName}</td>
                  <td>${item.contactTel}</td>
                  <td>${item.contactPhone}</td>
                  <td></td>
                  <td></td> -->
                  <td>
                      <div class="am-btn-toolbar">
                          <div class="am-btn-group am-btn-group-xs">
                              <button type="button" class="am-btn am-btn-default am-btn-xs am-text-secondary"
                                      onclick="edit(${item.id})">
                                  <span class="am-icon-pencil-square-o"></span> 编辑
                              </button>
                               <button type="button" class="am-btn am-btn-default am-btn-xs am-text-danger"
                                        onclick="del(${item.id})">
                                    <span class="am-icon-trash-o"></span> 删除
                                </button>
                          </div>
                      </div>
                  </td>
              </tr>
          </c:forEach>
          </tbody>
      </table>
      <div id="kkpager"></div>
</div>


<script type="text/javascript">
        $(function () {
            ishop.kkpager(${pager.pageNo},${pager.pageCount},${pager.totalRecord},selectPage);
        });
        function selectPage(n){
            var queryString = $('#_searchForm').formSerialize();
            location.href = "${ctx}/admin/<%=beanInfo.alias%>/index.do?"+queryString+"&pageNo=" + n;
        }

        function _search(){
            var queryString = $('#_searchForm').formSerialize();
            var url ="${ctx}/admin/<%=beanInfo.alias%>/index.do?"+queryString;
            location.href = url;
        }

        function add(){
                location.href="${ctx}/admin/<%=beanInfo.alias%>/add.do?pageNo=${pager.pageNo}";
        }
        function edit(id){
                location.href="${ctx}/admin/<%=beanInfo.alias%>/edit.do?pageNo=${pager.pageNo}&id="+id;
        }
        function del(id){
             if(confirm("确定删除？")){
                location.href="${ctx}/admin/<%=beanInfo.alias%>/delete.do?pageNo=${param.pageNo}&id="+id;
             }
         }
</script>
